<%@page import="utils.CMUser"%>
<%@ page language="java" contentType="text/html; charset=windows-1255"
    pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
<title>Edit Personal Details</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="common_scripts.js" ></script>
</head>
<body onload = "setPage('change_details')">
<%@ include file="WEB-INF/private/body_wrapper_header.html" %>


<% 
	
if (request.getSession(false) == null || request.getSession(false).getAttribute("username") == null){
	response.sendError(HttpServletResponse.SC_FORBIDDEN, "Please login first");
	return;
}
		
%>

<h1>Change details of <%=request.getSession(false).getAttribute("username") %></h1>

<form method="post" action="EditUserDetails" onsubmit="return verifyUpdateForm()">
<% CMUser cmUser = new CMUser(getServletContext(), (String)request.getSession(false).getAttribute("username")); %>

<p>
<input id="input_username" type="hidden" name="username" maxlength="32" value="<%= request.getSession(false).getAttribute("username") %>"/>
</p>

<table>
<tr>
	<td>Password:</td>
	<td>
		<input id="input_pass" type="password" name="password" maxlength="32" onkeyup="verifyPassword(); verifyPasswordVerify()" />
	</td> 
	<td id = "img_pass"></td>
</tr>
<tr>
	<td>Password Verify:</td>
	<td> <input id="input_pass_verify" type="password" name="password" maxlength="32" onkeyup="verifyPasswordVerify()" /></td> 
	<td id = "img_pass_verify"></td>
</tr>
<tr>
	<td>First Name: </td>
	<td><input type="text" id="input_first_name" name="first_name" maxlength="32" onkeyup="verifyFirstName()" value="<%= cmUser.getFirstName() %>" /></td> 
	<td id = "img_first_name"></td>
</tr>
<tr>
	<td>Last Name: </td>
	<td><input type="text" id="input_last_name" name="last_name" maxlength="32" onkeyup="verifyLastName()" value="<%= cmUser.getLastName() %>"/></td> 
	<td id = "img_last_name"></td>
</tr>
<tr>
	<td>Phone Number: </td>
	<td><input type="text" id="input_phone_number" name="phone_number" maxlength="32" onkeyup="verifyPhoneNumber()" value="<%= cmUser.getPhoneNumber() %>" /></td> 
	<td id = "img_phone_number"></td>
</tr>
<tr>
	<td></td>
	<td><input type="submit" value="Submit"></input></td>
</tr>
</table>

</form>


<%@ include file="WEB-INF/private/body_wrapper_footer.html" %>
</body>
</html>